package com.wodsy.phoenix.dataobject.userc.model;

import com.wodsy.phoenix.dataobject.base.PhoenixResponse;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;

/**
 * Created by admin on 2015/4/20.
 */
@Entity
@Table(name = "tb_mobile_captcha", schema = "", catalog = "userc")
public class MobileCaptcha implements Serializable, PhoenixResponse {
    private long id;
    private long mobile;
    private String captcha;
    private Timestamp createTime;

    @Id
    @Column(name = "id")
    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "mobile")
    public long getMobile() {
        return mobile;
    }

    public void setMobile(long mobile) {
        this.mobile = mobile;
    }

    @Basic
    @Column(name = "captcha")
    public String getCaptcha() {
        return captcha;
    }

    public void setCaptcha(String captcha) {
        this.captcha = captcha;
    }

    @Basic
    @Column(name = "create_time")
    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        MobileCaptcha that = (MobileCaptcha) o;

        if (id != that.id) return false;
        if (mobile != that.mobile) return false;
        if (captcha != null ? !captcha.equals(that.captcha) : that.captcha != null) return false;
        if (createTime != null ? !createTime.equals(that.createTime) : that.createTime != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = (int) (id ^ (id >>> 32));
        result = 31 * result + (int) (mobile ^ (mobile >>> 32));
        result = 31 * result + (captcha != null ? captcha.hashCode() : 0);
        result = 31 * result + (createTime != null ? createTime.hashCode() : 0);
        return result;
    }
}
